<?
include('./decode.php');
$location=$_GET['location'];
$lora= new lora();
$data=$lora->readData();
$accessData=array();
foreach($data as $arr){
    if($arr[3]==$location){
        if(strlen($arr[4])<2){
            $arr[4]='unkonw region';
        }
        if($arr[4]=='KR920'||$arr[4]=='EU433'||$arr[4]=='unkonw region'){
            $arr[5]='Not Support';
        }else{
            $arr[5]='Support';
        }
        $accessData[]=$arr;
    }
}
$data=$accessData[0];
header('Content-Type:application/json; charset=utf-8');
exit(json_encode($data,JSON_UNESCAPED_UNICODE));
// var_dump($accessData);
?>